package ru.nsu.fit.shared.engine;

import ru.nsu.fit.shared.data_base_manager.DatabaseManager;

/**
 * @author Timur Zolotuhin (tzolotuhin@gmail.com)
 */
public class AskJoeEngine implements  Runnable {
    @Override
    public void run() {
        // main loop
        while(true) {
            System.out.println("Update... ");
            try {
                DatabaseManager.updateQuestions();
                DatabaseManager.updatePreCloseQuestions();
            } catch (Throwable ex){
                ex.printStackTrace();
            }
            // sleep
            try {
                Thread.sleep(5 * 1000);
            } catch (Exception ex) {}
        }
    }
}
